home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_05 / colton / ips.x < prev    next >
Text File  |  1995-03-23  |  2KB  |  111 lines

  1. /*
  2.  * Listing 1 - ips.x
  3.  */
  4.  
  5.  
  6. /****  Client/Server Messages  ****/
  7.  
  8. const    IPS_DECODE                = 0;
  9. const    IPS_OK_ID                = 1;
  10. const    IPS_UNSUPPORTED_FORMAT            = 2;
  11. const    IPS_UNKNOWN_FORMAT            = 3;
  12.  
  13. const    IPS_REQUEST_OPS                = 4;
  14. const    IPS_SEND_OPS                = 5;
  15.  
  16. const    IPS_REQUEST_LOADERS            = 6;
  17. const    IPS_SEND_LOADERS            = 7;
  18.  
  19. const    IPS_REQUEST_SAVERS            = 8;
  20. const    IPS_SEND_SAVERS                 = 9;
  21.  
  22. const    IPS_REQUEST_IMAGE            = 10;
  23. const    IPS_SEND_IMAGE                = 11;
  24.  
  25. const    IPS_PROCESS                = 12;
  26. const    IPS_PROCESS_OK                = 13;
  27.  
  28. const    IPS_IMAGE_RELEASE            = 14;
  29. const    IPS_RELEASE_OK                = 15;
  30. const    IPS_IMAGE_NOT_AVAIL            = 16;
  31.  
  32. const    IPS_INIT                = 17;
  33. const    IPS_HELLO                = 18;
  34.  
  35. const    ERROR                    = 255;
  36.  
  37. /******** Image/Text Sizes ********/
  38.  
  39. const    MAXPIX                     = 4194304;
  40.  
  41. /********** Structures ************/
  42.  
  43. struct raw_data {
  44.     string    filename<>;
  45.     string    format<>;
  46.     opaque    data<MAXPIX>;
  47. };
  48.  
  49. struct converted_data {
  50.     opaque    data<MAXPIX>;
  51. };
  52.  
  53. struct list {
  54.     string    name<>;
  55.     struct list *next;
  56. };
  57.  
  58. struct proc_data {
  59.     int        id;
  60.     string    command<>;
  61.     int        argc;
  62.     list    argv;
  63. };
  64.  
  65. struct request_send {
  66.     int        id;
  67.     string    format<>;
  68.     int        argc;
  69.     list    argv;
  70. };
  71.  
  72. /********* Main Stuff ***********/
  73.  
  74. union Packet switch (int op) {
  75.   case IPS_INIT:                void;
  76.   case IPS_HELLO:                string hello_string<>;
  77.  
  78.   case IPS_DECODE:                raw_data raw_img;
  79.   case IPS_OK_ID:                int id;
  80.   case IPS_UNSUPPORTED_FORMAT:    void;
  81.   case IPS_UNKNOWN_FORMAT:        void;
  82.  
  83.   case IPS_REQUEST_OPS:            void;
  84.   case IPS_SEND_OPS:            list operators;
  85.  
  86.   case IPS_REQUEST_LOADERS:        void;
  87.   case IPS_SEND_LOADERS:        list loaders;
  88.  
  89.   case IPS_REQUEST_SAVERS:        void;
  90.   case IPS_SEND_SAVERS:            list savers;
  91.  
  92.   case IPS_REQUEST_IMAGE:        request_send send_ops;
  93.   case IPS_SEND_IMAGE:            converted_data img;
  94.  
  95.   case IPS_PROCESS:                proc_data proc;
  96.   case IPS_PROCESS_OK:            void;
  97.  
  98.   case IPS_IMAGE_RELEASE:        int place_holder;
  99.   case IPS_RELEASE_OK:            void;
  100.   case IPS_IMAGE_NOT_AVAIL:        void;
  101.  
  102.   case ERROR:                    void;
  103.   default:                         void;
  104. };
  105.  
  106. program IPSPROG {
  107.   version IPSVERS {
  108.     Packet IPS(Packet) = 1;
  109.   } = 1;
  110. } =  0x20000001;
  111.